import React,{useState,useEffect} from "react"
import { useSingleState } from "nice-hooks";
import { withRouter,useHistory  } from 'react-router-dom'
import axios from 'axios'
import { 
    Table,
 } from 'antd';

function Shool(){
    const [state,setState]=useSingleState({

    })

    useEffect(()=>{
      // axios.post("https://api-service.chanmama.com/v1/product/category",{
      //   type:"all"
      // }).then(res=>{
      //   console.log(res)
      // })
    },[]);

    const dataSource = [
        {
          key: '1',
          name: '胡彦斌',
          age: 32,
          address: '西湖区湖底公园1号',
        },
        {
          key: '2',
          name: '胡彦祖',
          age: 42,
          address: '西湖区湖底公园1号',
        },
    ];
    const columns = [
        {
          title: 'TITLE',
          dataIndex: 'name',
          key:"name",
          render: (text, record, index) => <div>{text}, {index}</div>,
        },
        {
          title: 'AGE',
          dataIndex: 'age',
          key:"age",
        },
        {
          title: 'ADDRESS',
          dataIndex: 'address',
          key:"address",
        },
    ];

    return(
        <div>
            <Table dataSource={dataSource} columns={columns} />
        </div>
    )
}

export default Shool